<%@taglib prefix="html" uri="struts-html" %>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@taglib prefix="html" uri="struts-html" %>
<%@taglib prefix="c" uri="jstl" %>
<%@taglib prefix="fn" uri="jstl-fn" %>

    <jsp:include page="Templates/metas.jsp"/>

    <body id="body_admin">
        <!--[if lt IE 7]>
            <p class="chromeframe">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> or <a href="http://www.google.com/chromeframe/?redirect=true">activate Google Chrome Frame</a> to improve your experience.</p>
        <![endif]-->
       <jsp:include page="Templates/header.jsp"/>
    <section id="container_admin">
       <jsp:include page="Templates/menuForaneo.jsp"/>
       
    <div class="content_admin">
    
        
        	<html:form action='/administrador/AgregarComentarioVal' method='post'>
        		<input type="hidden" name="cve_usuario" id="cve_usuario" value="" />
        	</html:form>
        	
        	<table class="table_reg" style="text-align: left;">
        		<caption>Comentarios</caption>
        		<tr>
        			<th colspan="2" class="txt_red"> <html:errors /> </th>
        		</tr>
        		<tr>
        			<td>
        				<table class="table_datosRed">
        				<thead>
        					<tr>
        						<th>Cve Comentario</th>
        						<th>NIP</th>
        						<th>Nombre</th>
        						<th>Comentario</th>
        						<th>Fecha</th>
        						<th>Contestado</th>
        						<th></th>
        					</tr>     
        				</thead>
        				<tbody>   					
        					<c:forEach items="${comentarios}" var="comentarios"> 
	        					<tr class="body_table">
	        						<td>${comentarios.cve_comentario}</td>
	        						<td>${comentarios.nip}</td>
	        						<td>${comentarios.nombre} ${comentarios.apellidos}</td>
	        						<td>${comentarios.comentario}</td>
	        						<td>${comentarios.fecha}</td>
	        						<td>
	        							<c:if test="${comentarios.tipo eq '2'}">
	        								SI
	        							</c:if>
	        							<c:if test="${comentarios.tipo ne '2'}">
	        								NO
	        							</c:if>
	        						</td>
	        						<td> <a href="javascript:void(0)" onclick="return submit(${comentarios.cve_usuario})">Ver</a> </td>
	        						
        					</c:forEach>
        				</tbody>
        				</table>
        			</td>
        		</tr>
        	</table>
      
        	<script type="text/javascript">
				function submit(cve){
						document.getElementById("cve_usuario").value = cve;
						document.forms['agregarComentarioForm'].submit();
						return true;
					}
        	</script>
         </div>
        </section>